/*
 * @Description: lodash学习
 * @Author: rendc
 * @Date: 2025-10-30 10:27:05
 * @LastEditors: rendc
 * @LastEditTime: 2025-10-30 10:31:51
 */
var _ = require('lodash');
// console.log('🤡 CC - _:', _);
var obj1 = {
  name:'zs',
  age:18
}
// 浅拷贝
var obj2 = obj1;
console.log('🤡 CC - obj2:', obj2);
obj2.name = 'obj2';
console.log('🤡 CC - obj1.name:', obj1.name); // obj2
console.log('🤡 CC - obj2.name:', obj2.name);// obj2
// 深拷贝 
// 1. 遍历赋值
// 2. 序列化
// 3. _
var obj3 = _.cloneDeep(obj1);
obj3.name = 'obj3';
console.log('🤡 CC - obj1.name:', obj1.name); // obj2
console.log('🤡 CC - obj3.name:', obj3.name); // obj3